<?php
namespace Rainrock\Framework\Controller;

use Rainrock\Framework\kernel\base\CLog;
use Rainrock\Framework\kernel\core\Controller;
use Rainrock\Framework\kernel\socket\WebSocket;

/**
*	服务端websocket
*/
class WebsocketController extends Controller{
	
	public function startAction()
	{
		if(PHP_SAPI != 'cli'){
			CLog::error('plase use cli input:php '.ROOT_PATH.'/index.php websocket/start');
			return;
		}
		
		$obj = new WebSocket();
		$obj->start();
	}
	
	
	public function stopAction()
	{
		$obj = new WebSocket();
		$obj->stop();
		return 'stop success';
	}
}